<?php if ( ! defined('BASEPATH')) exit('This file does not run directly. Sorry.'); ?>
<?php
/**
 * Kalaisoo.
 *
 * A lightweight no-framework framework written in PHP.
 *
 * @package Kalaisoo
 * @subpackage HTML
 * @author $Author: info@sah-company.com $
 * @version $Id: textile.php 127 2012-01-12 01:46:11Z info@sah-company.com $
 */

/**
 * Load third party "Textile".
 *
 * The official Textile 2.0.0 has a bug when rendering lists. This is fixed
 * in the version included here. I found the fix somewhere on the web.
 *
 * @see http://textile.thresholdstate.com
 * @see http://forum.textpattern.com/viewtopic.php?pid=229345 for some fixes
 */
require BASEPATH.'/vendor/textile-2.0.0.1/classTextile'.EXT;

/**
 * returns a string with (X)HTML.
 *
 * This function uses Textile to convert a string into XHTML code.
 *
 * @param string The string to convert into XHTML using Textile
 * @return string XHTML
 */
function textile($text)
{
    $textile = new Textile();
    return $textile->TextileThis($text);
}

/**
 * returns the raw text of a text written in Textile mode.
 *
 * @param string $text of type Textile
 * @return string
 */
function detextile($text)
{
    $textile = new Textile();
    return strip_tags($textile->TextileThis($text));
}
?>